<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ include file="/commons/taglibs.jsp" %>
 
 
<jsFileName><!--js/pageJS/organization/page_orgPermissionManage.js--></jsFileName>
 
<form id="setUserPermissionFormId" name="setUserPermissionFormName" method="post" action="auth/perUser.do">
	<input name="userId" type="hidden" value="${userid}">
	<input name="complength" type="hidden" value="17">
	<table class="form-table">
		<thead>
			<tr>
				<td colspan="3">设置 [<B>${realname}</B>] 的权限</td>
			</tr>
		</thead>
		<tr align="left" height="35px">
			<td colspan="3" valign="middle" class="L12bold">
				<input id="btncheckall" type="button" checked="false" class="btn-short" value="返回"
					onClick="Ext.milan.pagejs.organization.page_orgpermissionmanage.backUserList(this);">
				<input id="btncheckall" type="button" checked="false" class="btn-short" value="全选"
					onClick="Ext.milan.pagejs.organization.page_orgpermissionmanage.chkAllClick(this);">
				<input id="btnexpandall" type="button" checked="false" class="btn-long" value="全部展开"
					onClick="Ext.milan.pagejs.organization.page_orgpermissionmanage.expandall(this);">
				
			</td>
		</tr>
		
		<c:forEach items="${list}" var="item" varStatus="status">
		<tr>
			<td width="20" align="center" valign="middle">
				<input name="CompChk" type="checkbox" CompID="chkComp${status.index}"
					id="CompChk" title="点击打勾开启该权限" onClick="Ext.milan.pagejs.organization.page_orgpermissionmanage.chkComp(this);" checked>
			</td>
			<td width="90" align="left" style="cursor: hand;"  class="leftblank"
				onClick="Ext.milan.pagejs.organization.page_orgpermissionmanage.showout('setUserPermissionFormId', '${status.index}');">
				<img id="setUserPermissionFormIdimg${status.index}" src="skins/default/images/plus.jpg" width="9" height="9" align="absmiddle">
				<span class="leftblank">${item.text}</span>
			</td>
			<td>
				<table width="100%" cellpadding="0" cellspacing="0" class="l12" id="setUserPermissionFormIdtable${status.index}" style="display: none">
				<c:forEach items="${item.item}" var="subitem" varStatus="status2">
					<tr  class="l12" id="Per${subitem.id}">
						<td width="130" align="left" valign="middle">
							<label for="chkper${subitem.id}" style="cursor: hand;">
								<input title="点击打勾开启该权限" name="chkper" type="checkbox" id="chkper${subitem.id}" CompID="chkComp${status.index}"
									value="${subitem.id}"
									${subitem.ifCheck == true ? 'checked' : ''} OrgChecked="${subitem.en ==true ? '1' : '0'}"
									PerLV="${subitem.en ==true ? '0' : '1'}"
									PerName="${subitem.text}" 
									onClick="Ext.milan.pagejs.organization.page_orgpermissionmanage.chkClick(this);">&nbsp;<font color="${subitem.en ==true ? '#CC0000' : '#000000'}">${subitem.text}</font>
							</label>
						</td>
						<td align="left" valign="middle" style="word-break: break-all;" class="leftblank">${subitem.content}</td>
					</tr>
				</c:forEach>
				</table>
			</td>
		</tr>
		</c:forEach>
		
	</table>
	<div class="win-btn-panel">
		<a class="btn_short" title="点击保存当前设置" href="javascript:void(0)" 
			onClick="Ext.milan.pagejs.organization.page_orgpermissionmanage.save('setUserPermissionFormId');">确 定</a>
	</div>
</form>
 
<script language="javascript"> 
var setUserPermissionFormId=$("setUserPermissionFormId");
 
var selects = setUserPermissionFormId.chkper;
var Compchks = setUserPermissionFormId.CompChk;
var tmpChk;
for (var i=0; i<selects.length; i++)
{
	if (!selects[i].checked)
	{
		for (var x=0; x<Compchks.length; x++)
		{
			if (Compchks[x].getAttribute('CompID') == selects[i].getAttribute('CompID'))
				break;
		}
		
		if (Compchks[x]!=null) Compchks[x].checked = false;
	}
}
</script>
 